package br.com.binding.client.event;

import java.util.EventObject;
/**
 * An Event that represents a change on a property. Contains the name of the 
 * property, the old value, the new one and the source of the event.
 * @author Marcelo Emanoel
 *
 */
public class PropertyChangeEvent extends EventObject {

	private static final long serialVersionUID = -7414186405197338333L;

	private String propertyName;
	private Object oldValue;
	private Object newValue;
	private Object source;

	public PropertyChangeEvent(Object source, String propertyName, Object old, Object newOne) {
		super(source);
		setPropertyName(propertyName);
		setOldValue(old);
		setNewValue(newOne);
	}
	
	public String getPropertyName() {
		return propertyName;
	}
	
	public void setPropertyName(String propertyName) {
		this.propertyName = propertyName;
	}
	
	public Object getOldValue() {
		return oldValue;
	}
	
	public void setOldValue(Object oldValue) {
		this.oldValue = oldValue;
	}
	
	public Object getNewValue() {
		return newValue;
	}
	
	public void setNewValue(Object newValue) {
		this.newValue = newValue;
	}
	
	public Object getSource() {
		return source;
	}
	
	public void setSource(Object source) {
		this.source = source;
	}

}
